package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface ReportMapper {

    @Select("select sum(amount) from orders where status = #{status} and order_time between #{begin} and  #{end} ")
    Double sumOfOrders(Map map);

    Integer countByOrders(Map map);

    Integer geuUserCount(LocalDateTime beginTime, LocalDateTime endTime);


    List<GoodsSalesDTO> getDishTop10(LocalDateTime beginTime, LocalDateTime endTime);
}
